package 华为OD机试真题2023.基础题;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;

public class HJ08_分界线 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new File("src/main/java/华为OD机试真题2023/基础题/input/08.txt"));
        String[] newspaper = in.nextLine().split(" ");
        String[] letter = in.nextLine().split(" ");
        for (String s : letter) {
            char[] sc = s.toCharArray();
            Arrays.sort(sc);
            boolean flag = false;
            for (String p : newspaper) {
                char[] pc = p.toCharArray();
                Arrays.sort(pc);
                if (Arrays.equals(pc, sc)) {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                System.out.println(false);
                return;
            }
        }
        System.out.println(true);
    }
}
